  <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('单据详情')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-total-edit" th:object="${tOrderTotal}">
        <input name="id" th:field="*{id}" type="hidden" id="orderId">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">单据类型：</label>
            <div class="col-sm-8">
                <select name="orderType" class="form-control m-b" th:with="type=${@dict.getType('ORDER_TOTAL_TYPE')}" disabled>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{orderType}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单据状态：</label>
            <div class="col-sm-8">
                <select name="orderStatus" class="form-control m-b" th:with="type=${@dict.getType('ORDER_TOTAL_STATUS')}" disabled>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{orderStatus}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">客户公司名称：</label>
            <div class="col-sm-8">
                <select name="customerId" class="form-control m-b" th:with="type=${@productService.getcustomerInfo()}" disabled>
                    <option th:each="dict : ${type}" th:text="${dict.userName}" th:value="${dict.id}" th:field="*{customerId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">送货地址：</label>
            <div class="col-sm-8">
                <input name="shippingAddress" th:field="*{shippingAddress}" class="form-control" type="text" readonly>
            </div>
        </div>
       <div class="form-group">
            <label class="col-sm-3 control-label">外部编号：</label>
            <div class="col-sm-8">
                <input name="outOrderNo" th:field="*{outOrderNo}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单据日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="date" th:value="${#dates.format(tOrderTotal.orderDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注信息：</label>
            <div class="col-sm-8">
                <textarea name="remark" class="form-control" readonly>[[*{remark}]]</textarea>
            </div>
        </div>
        <!--            <div class="form-group">
                        <label class="col-sm-3 control-label">预留字段,保存格式为json字段：</label>
                        <div class="col-sm-8">
                            <textarea name="field" class="form-control">[[*{field}]]</textarea>
                        </div>
                    </div>-->
    </form>
</div>
<div class="">
    单品信息:
</div>
<div class="col-sm-12 select-table table-striped">
    <table id="bootstrap-table"></table>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var orderId=$("#orderId").val();
    var prefix = ctx + "system/total";
    var prefix1 = ctx + "system/product"
    var editFlag = [[${@permission.hasPermi('system:total:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:total:remove')}]];
    $(function(){
         var options ={
             url: prefix1 + "/list?orderId="+orderId,
             modalName: "产品总表",
             columns: [
             {
                 field: 'itemNO',
                 title: '单品号'
             },
             {
                 field: 'productNo',
                 title: '产品编号'
             },
             {
                 field: 'productName',
                 title: '产品名称'
             },
             {
                 field: 'epc',
                 title: 'EPC'
             }
           /*  {
                 title: '操作',
                 align: 'center',
/!*                 formatter: function(value, row, index) {
                     var actions = [];
                     actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
                     actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                     return actions.join('');
                 }*!/
             }*/]
         };
             $.table.init(options);
         });
    $("#form-total-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-total-add').serialize());
        }
    }

    $("input[name='orderDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
    $("#form-total-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-total-edit').serialize());
        }
    }

    $("input[name='orderDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>